const std = @import("std");
const rl = @import("raylib");

pub fn drawTriangle(x: f32, y: f32, height: f32, color: *const rl.Color) void {
    const hypo = 2.0 * height;
    const top_y = y - hypo;
    const bottom_y = y + height;
    const long_leg = 0.866 * hypo;
    const left_x = x - long_leg;
    const right_x = x + long_leg;

    rl.gl.rlBegin(rl.gl.rl_triangles);
    rl.gl.rlColor4ub(color.r, color.g, color.b, color.a);

    rl.gl.rlVertex2f(x, top_y);
    rl.gl.rlVertex2f(left_x, bottom_y);
    rl.gl.rlVertex2f(right_x, bottom_y);

    rl.gl.rlEnd();
}
